<style lang="less" scoped>
.table{
  position: absolute;
  left: 20%;
  top: 70%;
  transform: translateY(-50%);
  width: 300px;
  height: 400px;
  overflow-y: auto;
      border: 1px solid #ccc;
    box-shadow: 0 0 4px 2px #ccc;
}
</style>
<template>
  <div class="table">
    <el-table :data="table_data" style="width: 100%" @row-click="clickTable">
      <el-table-column prop="oid" label="订单编号"> </el-table-column>
      <el-table-column prop="type" label="类别"> </el-table-column>
      <el-table-column prop="state" label="状态"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {mapMutations} from 'vuex'
export default {
  data() {
    return {
      table_data: [
        {
          oid: 20201201,
          type: "鲁班锁",
          state: "检测中",
        },
                {
          oid: 20201202,
          type: "鲁班锁",
          state: "待检测",
        },
                {
          oid: 20201204,
          type: "鲁班锁",
          state: "已检测",
        },
                {
          oid: 20201205,
          type: "鲁班锁",
          state: "检测中",
        },
                {
          oid: 20201203,
          type: "鲁班锁",
          state: "待检测",
        },
                {
          oid: 20201211,
          type: "鲁班锁",
          state: "已检测",
        },
      ],
    };
  },
  methods: {
    ...mapMutations('clickModule',['setClickData']),
    clickTable(item){
      this.setClickData(item);
    }
  },
  //生命周期 - 创建完成
  created() {},
  //DOM挂载完毕
  mounted() {},
};
</script>
